package DateStructure;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 殇
 * Date: 2025-07-24
 * Time: 11:06
 */
public class LinkedList0 {
    public static void main(String[] args) {
        List<Integer> list1=new LinkedList<>();
        List<Integer> array=new ArrayList<>();
        for(int i=0;i<5;i++) array.add(i);
        List<Integer> list2=new LinkedList<>(array);
        System.out.println(list2);

        //插入
        list2.add(5);
        list2.add(list2.size(),6);
        System.out.println(list2);

        //删除
        list2.remove(6);
        list2.remove(Integer.valueOf(5));
        System.out.println(list2);
    }
}
